<?php

/**
* Manager with filter list.
* 
*/
class Links_Backend_FilteredList extends Kernel_Manager_FilteredList 
{
    
    /**
     * Возвращает параметры, передаваемых в конструктор компонента, реализующего
     * указанное действие.
     *
     * @param   string  $name
     * @return  array
     */
    protected function _getActionParams($name) 
    {
        $params = parent::_getActionParams($name);
        
        $add_filter = sprintf('&%s=filter', 'category');
        switch ($name) 
        {
            case 'add':
            case 'edit':
                $params['redirect_url'] .= $add_filter;
                break;
            case 'delete':
                $params['back'] .= $add_filter;
                break;
        }
        
        return $params;
    }
    
    /**
     * @desc Return manager components package.
     *
     * @return  string
     */
    protected function _package() 
    {
        return 'Links_Backend_' . str_camelize($this->_filter);
    }
       
}